package com.slofzx.nuoda.evaluation.project.enums;

import com.slofzx.nuoda.common.EnumConfig;
import com.slofzx.nuoda.common.config.Type;
@EnumConfig(
        id = "adjust-ratio-type",
        name = "系数调整"
)
public enum  AdjustRatioEnum implements Type {
    COST_RATIO("cost_ratio","成本系数"),
    OUTPUT_RATIO("output_ratio","产量系数"),
    INVEST_RATIO("invest_ratio","投资系数"),
    ;


    AdjustRatioEnum(String id, String name) {
        this.id = id;
        this.name = name;
    }

    private String id;
    private String name;

    public String getId() {
        return this.id;
    }

    public String getName() {
        return this.name;
    }



    /**
     * 根据id获取枚举值
     * @param id
     * @return
     */
    public static AdjustRatioEnum getEnum(String id) {
        if(id == null) {
            return null;
        }
        for(AdjustRatioEnum item: AdjustRatioEnum.values()) {
            if(id.equals(item.getId())) {
                return item;
            }
        }

        return null;
    }
}
